Optimal. Leaf size=197 \[ \frac {a^{5/2} (19 A+20 B+8 C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 d}+\frac {a^3 (27 A-12 B-56 C) \sin (c+d x)}{12 d \sqrt {a+a \sec (c+d x)}}-\frac {a^2 (A-4 B-8 C) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}-\frac {a (3 A-4 C) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^{5/2} \sin (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.42, antiderivative size = 197, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.116, Rules used = {4171, 4103,
4100, 3859, 209} \begin {gather*} \frac {a^{5/2} (19 A+20 B+8 C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{4 d}+\frac {a^3 (27 A-12 B-56 C) \sin (c+d x)}{12 d \sqrt {a \sec (c+d x)+a}}-\frac {a^2 (A-4 B-8 C) \sin (c+d x) \sqrt {a \sec (c+d x)+a}}{2 d}-\frac {a (3 A-4 C) \sin (c+d x) (a \sec (c+d x)+a)^{3/2}}{6 d}+\frac {A \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^{5/2}}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3859
Rule 4100
Rule 4103
Rule 4171
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+a \sec (c+d x))^{5/2} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos (c+d x) (a+a \sec (c+d x))^{5/2} \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x))^{5/2} \left (\frac {1}{2} a (5 A+4 B)-\frac {1}{2} a (3 A-4 C) \sec (c+d x)\right ) \, dx}{2 a}\\ &=-\frac {a (3 A-4 C) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^{5/2} \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x))^{3/2} \left (\frac {1}{4} a^2 (21 A+12 B-8 C)-\frac {3}{4} a^2 (A-4 B-8 C) \sec (c+d x)\right ) \, dx}{3 a}\\ &=-\frac {a^2 (A-4 B-8 C) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}-\frac {a (3 A-4 C) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^{5/2} \sin (c+d x)}{2 d}+\frac {2 \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (\frac {1}{8} a^3 (27 A-12 B-56 C)+\frac {1}{8} a^3 (15 A+36 B+40 C) \sec (c+d x)\right ) \, dx}{3 a}\\ &=\frac {a^3 (27 A-12 B-56 C) \sin (c+d x)}{12 d \sqrt {a+a \sec (c+d x)}}-\frac {a^2 (A-4 B-8 C) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}-\frac {a (3 A-4 C) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^{5/2} \sin (c+d x)}{2 d}+\frac {1}{8} \left (a^2 (19 A+20 B+8 C)\right ) \int \sqrt {a+a \sec (c+d x)} \, dx\\ &=\frac {a^3 (27 A-12 B-56 C) \sin (c+d x)}{12 d \sqrt {a+a \sec (c+d x)}}-\frac {a^2 (A-4 B-8 C) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}-\frac {a (3 A-4 C) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^{5/2} \sin (c+d x)}{2 d}-\frac {\left (a^3 (19 A+20 B+8 C)\right ) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 d}\\ &=\frac {a^{5/2} (19 A+20 B+8 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 d}+\frac {a^3 (27 A-12 B-56 C) \sin (c+d x)}{12 d \sqrt {a+a \sec (c+d x)}}-\frac {a^2 (A-4 B-8 C) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}-\frac {a (3 A-4 C) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{6 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^{5/2} \sin (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.26, size = 152, normalized size = 0.77 \begin {gather*} \frac {a^2 \sec \left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \sqrt {a (1+\sec (c+d x))} \left (6 \sqrt {2} (19 A+20 B+8 C) \text {ArcSin}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right ) \cos ^{\frac {3}{2}}(c+d x)+2 (33 A+12 B+16 C+(9 A+48 B+128 C) \cos (c+d x)+3 (11 A+4 B) \cos (2 (c+d x))+3 A \cos (3 (c+d x))) \sin \left (\frac {1}{2} (c+d x)\right )\right )}{48 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(582\) vs.
\(2(173)=346\).
time = 51.47, size = 583, normalized size = 2.96
method | result | size |
default | \(\frac {\sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (57 A \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right ) \cos \left (d x +c \right ) \sqrt {2}+60 B \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right ) \cos \left (d x +c \right ) \sqrt {2}+24 C \sqrt {2}\, \cos \left (d x +c \right ) \sin \left (d x +c \right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right )+57 A \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {2}\, \sin \left (d x +c \right )+60 B \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {2}\, \sin \left (d x +c \right )+24 C \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right )-24 A \left (\cos ^{4}\left (d x +c \right )\right )-108 A \left (\cos ^{3}\left (d x +c \right )\right )-48 B \left (\cos ^{3}\left (d x +c \right )\right )+132 A \left (\cos ^{2}\left (d x +c \right )\right )-48 B \left (\cos ^{2}\left (d x +c \right )\right )-256 C \left (\cos ^{2}\left (d x +c \right )\right )+96 B \cos \left (d x +c \right )+224 C \cos \left (d x +c \right )+32 C \right ) a^{2}}{48 d \cos \left (d x +c \right ) \sin \left (d x +c \right )}\) | \(583\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.20, size = 438, normalized size = 2.22 \begin {gather*} \left [\frac {3 \, {\left ({\left (19 \, A + 20 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + {\left (19 \, A + 20 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right )\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, {\left (6 \, A a^{2} \cos \left (d x + c\right )^{3} + 3 \, {\left (11 \, A + 4 \, B\right )} a^{2} \cos \left (d x + c\right )^{2} + 8 \, {\left (3 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right ) + 8 \, C a^{2}\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{24 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}}, -\frac {3 \, {\left ({\left (19 \, A + 20 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + {\left (19 \, A + 20 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right )\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - {\left (6 \, A a^{2} \cos \left (d x + c\right )^{3} + 3 \, {\left (11 \, A + 4 \, B\right )} a^{2} \cos \left (d x + c\right )^{2} + 8 \, {\left (3 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right ) + 8 \, C a^{2}\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{12 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 811 vs.
\(2 (173) = 346\).
time = 2.30, size = 811, normalized size = 4.12 \begin {gather*} -\frac {3 \, {\left (19 \, A \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 20 \, B \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 8 \, C \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - a {\left (2 \, \sqrt {2} + 3\right )} \right |}\right ) - 3 \, {\left (19 \, A \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 20 \, B \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 8 \, C \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + a {\left (2 \, \sqrt {2} - 3\right )} \right |}\right ) + \frac {16 \, {\left (3 \, \sqrt {2} B a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 9 \, \sqrt {2} C a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - {\left (3 \, \sqrt {2} B a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 7 \, \sqrt {2} C a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )} \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}} + \frac {12 \, \sqrt {2} {\left (19 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} A \sqrt {-a} a^{3} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 12 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} B \sqrt {-a} a^{3} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 171 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} A \sqrt {-a} a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 76 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} B \sqrt {-a} a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 89 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} A \sqrt {-a} a^{5} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 36 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} B \sqrt {-a} a^{5} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 9 \, A \sqrt {-a} a^{6} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 4 \, B \sqrt {-a} a^{6} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} - 6 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a + a^{2}\right )}^{2}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\cos \left (c+d\,x\right )}^2\,{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^{5/2}\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________